<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/theme/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/bootstrap/css/bootstrap-table.min.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/theme/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/theme/style.css" />
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/theme/bootstrap.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap/bootstrap-table.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap/bootstrap-table-locale-all.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/layerui/layer.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/layerui/layer.ext.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/skin/css/mobilecss/charge.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/skin/css/mobilecss/main.css">
    
    
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }
    </style>
</head>
<body>
<form class="form-inline definewidth m20" action="index.html" method="get"> 
<input type="text" name="gameUserId" id="gameUserId" placeholder="通过玩家ID搜索" value=""  style="width: 130px;height: 35px">
<select id="status" name="status" placeholder="订单状态搜索"  style="width: 135px;height: 39px" > 
    	<option value="" >全部</option>
   		<option value="0">初始化</option>
   		<option value="1" selected="selected">支付成功</option>
   		<option value="2">支付失败</option>
    </select>
<input id="startTime" placeholder="开始时间" type="date" style="width: 130px;height: 30px"> <input id="endTime" placeholder="结束时间" style=";width: 130px;height: 30px" type="date"> 
<button type="button" onclick="query()" class="btn btn-primary">查询</button>
</form>
<div><p><label id="orderStat"></label></p></div>
 <table id="mytab" class="table table-striped table-bordered"></table>  <br>
</body>
<script>
	
	function query() {
		var gameUserId = $('#gameUserId').val();
	    var status = $('#status option:selected').val();
	    var startTime = $('#startTime').val() ;
	    var endTime = $('#endTime').val() ;
	    
	    $.post("${pageContext.request.contextPath}/admin/order_mobile_stat.html",
	            {"gameUserId":gameUserId,"status":status,"startTime":startTime,"endTime":endTime},
	       function(data){
	            	var json = eval("("+data+")");
					if(json.statusCode =='200'){
						$("#orderStat").html("充值人数："+json.orderStatVo.nub +"&nbsp;&nbsp;  充值笔数："+json.orderStatVo.count+"&nbsp;&nbsp;  充值总金额："+(json.orderStatVo.money==null?0:json.orderStatVo.money));
					}
	      });
	    
	    
	    $('#mytab').bootstrapTable("refreshOptions", {
	        queryParams: function (params) {
	            params.numPerPage = params.limit;
	            params.pageNum = params.offset / params.limit + 1;
	            params.gameUserId = gameUserId;
	            params.status = status;
	            params.startTime = startTime;
	            params.endTime = endTime;
	            return params;
	        }
	    });
	    $('#mytab').bootstrapTable({
	        url: "${pageContext.request.contextPath}/admin/order_mobile_data.html", //数据源
	       // height:tableHeight(),
	        dataField: "rows", //服务端返回数据键值 就是说记录放的键值是rows，分页时使用总记录数的键值为total
	        pagination: true, //是否分页
	        pageSize: 10, //单页记录数
	        pageList : [10, 20,50,100,200 ],//分页步进值
	        sidePagination: "server", //服务端分页
	        contentType: "application/x-www-form-urlencoded", //请求数据内容格式 默认是 application/json 自己根据格式自行服务端处理
	        dataType: "json", //期待返回数据类型
	        method: "post", //请求方式
	        searchAlign: "left", //查询框对齐方式
	        locale: "zh-CN",
	        queryParams: function (params) {
	                params.numPerPage = params.limit;
	                params.pageNum = params.offset / params.limit + 1;
	                params.gameUserId = gameUserId;
	                params.status = status;
	                params.startTime = startTime;
	                params.endTime = endTime;
	                return params;
	            },
	            buttonsAlign: "left", //按钮对齐方式
	            paginationHAlign:"left",
	        columns: [{
	        	width: "5%",
				field: 'gameId',
				title: '玩家ID',
			}, {
	            field: "outUserName",
	            title: "昵称",
	        },{
	            field: "mallName",
	            title: "充值房卡数",
	        },{
	            field: "orMoney",
	            title: "金额",
	        },{
	        	width: "10%",
	            field: "status",
	            title: "状态",
	            formatter: function (value, row, index) {
	            	var html = '其他';
	            	if(row.status==0){
	            		html = '初始化';
	            	}else if(row.status==1){
	            		html = '支付成功';
	            	}else if(row.status==2){
	            		html = '支付失败';
	            	}
	                return html ;
	            }
	        },{
	            field: "remark",
	            title: "备注",
	        },{
	            field: "createTime",
	            title: "操作时间",
	        }]
	    }).on("click-row.bs.table", function (args, row, $element) {
	        
    });}
	

    $(function () {
    	query();
    });

	
</script>
</html>